﻿#ifndef __AVOID_BW_CONTROL_X_INTERFACE_HEAD_FILE_INCLUDED__
#define __AVOID_BW_CONTROL_X_INTERFACE_HEAD_FILE_INCLUDED__
#include "../control.h"

namespace swui
{
	// overload null
	class IFont : virtual public ctlRoot
	{
	public:
		//文字对齐
		enum class textAlign : unsigned{
			left, center, right
		};
	public:
		virtual ~IFont() { destroy(); };
	public:
		bool setFont(unsigned index);
		unsigned getFontIndex();
		std::shared_ptr<ctlFont> getFont();
	public:
		void setTextAlignMode(textAlign);
		textAlign getTextAlignMode();
	protected:
		ctlPoint _getTextSize();
		void _virtual_font_create();
		virtual void _flush_font_();
		void _draw_text_(_ctlInterior::drawInfo*, ctlColor color, ctlRect textRect);
	private:
		unsigned _font_index;
		textAlign _font_alignMode;
	};



} //namespace swui

#endif